//package com.yanfan.product.controller;
//
//import com.yanfan.common.core.domain.AjaxResult;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Schedules;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletResponse;
//
///**
// * @author caijinkang
// * @date 2022年12月08日 9:15
// */
//@RestController
//@RequestMapping("/production")
//@Api("生产管理")
//public class ProductionController {
//
//    @Autowired
//    private ProductionService productionService;
//    @Autowired
//    private ExcelService excelService;
//
//    @ApiOperation("绩效管理查询")
//    @GetMapping("/findPerformance")
//    public AjaxResult findPerformance(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize, @ApiParam(name = "date", value = "格式：yyyy-MM") @RequestParam String date) {
//        return productionService.findPerformance(currPage, pageSize, date);
//    }
//
//    @ApiOperation("生产管理查询")
//    @GetMapping("/findProduction")
//    public AjaxResult findProduction(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize, @ApiParam(name = "type", value = "类型（1、待处理，2、生产中，3、已完成）") @RequestParam Integer type) {
//        return productionService.findProduction(currPage, pageSize, type);
//    }
//
//    @ApiOperation("批次管理查询")
//    @GetMapping("/findBatchManagement")
//    public AjaxResult findBatchManagement(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize, @ApiParam(name = "type", value = "类型（1、待处理，2、生产中，3、已完成）") @RequestParam Integer type) {
//        return productionService.findBatchManagement(currPage, pageSize, type);
//    }
//
//    @ApiOperation("订单管理查询")
//    @GetMapping("/findOrderManagement")
//    public AjaxResult findOrderManagement(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize, @ApiParam(name = "type", value = "类型（1、待处理，2、生产中，3、已完成）") @RequestParam Integer type) {
//        return productionService.findOrderManagement(currPage, pageSize, type);
//    }
//
//    @ApiOperation("物料信息查询")
//    @GetMapping("/findMaterials")
//    public AjaxResult findMaterials(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize) {
//        return productionService.findMaterials(currPage, pageSize);
//    }
//
//    @ApiOperation("工位记录查询")
//    @GetMapping("/findStationRecord")
//    public AjaxResult findStationRecord(@ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize) {
//        return productionService.findStationRecord(currPage, pageSize);
//    }
//
//    @GetMapping("/findAttendanceRate")
//    @ApiOperation("出勤统计查询")
//    public AjaxResult findAttendanceRate(@ApiParam(name = "range", value = "日期格式") @RequestParam(required = false) String range, @ApiParam(name = "begin", value = "开始日期") @RequestParam(required = false) String begin, @ApiParam(name = "end", value = "结束日期") @RequestParam(required = false) String end, @ApiParam(name = "type", value = "日期类型") @RequestParam(required = false) Integer dateType) {
//        return productionService.findAttendanceRate(range, begin, end);
//    }
//
//    @GetMapping("/findOccupation")
//    @ApiOperation("工种人数查询")
//    public AjaxResult findOccupation() {
//        return productionService.findOccupation();
//    }
//
//
//    // -----新生产管理接口-----
//
//    @PostMapping("/findStationRecords")
//    @ApiOperation("工位记录查询")
//    public AjaxResult findStationRecords(@ApiParam(name = "stationBody", value = "工位记录入参") @RequestBody StationBody stationBody) {
//        return productionService.findStationRecords(stationBody);
//    }
//
//    @PostMapping("/addStationRecords")
//    @ApiOperation("新增工位记录")
//    public AjaxResult addStationRecords(@ApiParam(name = "stationRecords", value = "工位记录入参") @RequestBody StationRecords stationRecords) {
//        return productionService.addStationRecords(stationRecords);
//    }
//
//    @PostMapping("/updateStationRecords")
//    @ApiOperation("更新工位记录")
//    public AjaxResult updateStationRecords(@ApiParam(name = "stationRecords", value = "工位记录入参") @RequestBody StationRecords stationRecords) {
//        return productionService.updateStationRecords(stationRecords);
//    }
//
//    @PostMapping("/stationRecordsByReport")
//    @ApiOperation("下载工位记录")
//    public void stationRecordsByReport(HttpServletResponse response) {
//        productionService.stationRecordsByReport(response);
//    }
//
//    @PostMapping("/findMaterialsInformation")
//    @ApiOperation("物料信息查询")
//    public AjaxResult findMaterialsInformation(@ApiParam(name = "materialsBody", value = "物料信息入参") @RequestBody MaterialsBody materialsBody) {
//        return productionService.findMaterialsInformation(materialsBody);
//    }
//
//    @PostMapping("/addMaterialsInformation")
//    @ApiOperation("新增物料信息")
//    public AjaxResult addMaterialsInformation(@ApiParam(name = "materials", value = "物料信息入参") @RequestBody Materials materials) {
//        return productionService.addMaterialsInformation(materials);
//    }
//
//    @PostMapping("/updateMaterialsInformation")
//    @ApiOperation("更新物料信息")
//    public AjaxResult updateMaterialsInformation(@ApiParam(name = "materials", value = "物料信息入参") @RequestBody Materials materials) {
//        return productionService.updateMaterialsInformation(materials);
//    }
//
//    @PostMapping("/findMaterialsRecords")
//    @ApiOperation("查询物料信息详情")
//    public AjaxResult findMaterialsRecords(@ApiParam(name = "materialRecordsBody", value = "物料详情信息入参") @RequestBody MaterialRecordsBody materialRecordsBody) {
//        return productionService.findMaterialsRecords(materialRecordsBody);
//    }
//
//    @PostMapping("/materialsInformationByReport")
//    @ApiOperation("下载物料信息")
//    public void materialsInformationByReport(HttpServletResponse response) {
//        productionService.materialsInformationByReport(response);
//    }
//
//    @PostMapping("/updateMaterialsNumber")
//    @ApiOperation("更新物料出入库操作")
//    public AjaxResult updateMaterialsNumber(@ApiParam(name = "materials", value = "物料信息入参") @RequestBody Materials materials) {
//        return productionService.updateMaterialsNumber(materials);
//    }
//
//    @PostMapping("/materialsRecordsByReport")
//    @ApiOperation("下载物料详情出入库记录信息")
//    public void materialsRecordsByReport(HttpServletResponse response) {
//        productionService.materialsRecordsByReport(response);
//    }
//
//    @PostMapping("/findOrderLineDetails")
//    @ApiOperation("订单管理查询")
//    public AjaxResult findOrderLineDetails(@ApiParam(name = "orderBody", value = "订单管理入参") @RequestBody OrderBody orderBody) {
//        return productionService.findOrderLineDetails(orderBody);
//    }
//
//    @PostMapping("/addOrderLineDetails")
//    @ApiOperation("新增订单管理")
//    public AjaxResult addOrderLineDetails(@ApiParam(name = "orderLineDetails", value = "订单管理入参") @RequestBody OrderLineDetails orderLineDetails) {
//        return productionService.addOrderLineDetails(orderLineDetails);
//    }
//
//    @PostMapping("/updateOrderLineDetails")
//    @ApiOperation("更新订单管理")
//    public AjaxResult updateOrderLineDetails(@ApiParam(name = "orderLineDetails", value = "订单管理入参") @RequestBody OrderLineDetails orderLineDetails) {
//        return productionService.updateOrderLineDetails(orderLineDetails);
//    }
//
//    @GetMapping("/deleteOrderLineDetails")
//    @ApiOperation("根据id删除订单管理信息")
//    public AjaxResult deleteOrderLineDetails(@RequestParam Integer id) {
//        return productionService.deleteOrderLineDetails(id);
//    }
//
//    // 查询订单详情信息->，批量修改批次or批量新增批次
//    @PostMapping("/findOrderDetailsByBatches")
//    @ApiOperation("根据订单编号查询批次信息")
//    public AjaxResult findOrderDetailsByBatches(@ApiParam(name = "orderBody", value = "（根据订单编号number找批次）") @RequestBody OrderBody orderBody) {
//        return productionService.findOrderDetailsByBatches(orderBody);
//    }
//
//    @PostMapping("/findOrderLineDetailsByTarget")
//    @ApiOperation("订单管理查询七项指标信息")
//    public AjaxResult findOrderLineDetailsByTarget() {
//        return productionService.findOrderLineDetailsByTarget();
//    }
//
//    @PostMapping("/findSchedules")
//    @ApiOperation("生产排程信息查询")
//    public AjaxResult findSchedules(@ApiParam(name = "schedulesBody", value = "生产排程入参") @RequestBody SchedulesBody schedulesBody) {
//        return productionService.findSchedules(schedulesBody);
//    }
//
//    @PostMapping("/addSchedules")
//    @ApiOperation("新增生产排程信息")
//    public AjaxResult addSchedules(@ApiParam(name = "schedules", value = "生产排程入参") @RequestBody Schedules schedules) {
//        return productionService.addSchedules(schedules);
//    }
//
//    @PostMapping("/updateSchedules")
//    @ApiOperation("更新生产排程信息")
//    public AjaxResult updateSchedules(@ApiParam(name = "schedules", value = "生产排程入参") @RequestBody Schedules schedules) {
//        return productionService.updateSchedules(schedules);
//    }
//
//    @ApiOperation("下载生产排程信息")
//    @PostMapping("/schedulesByReport")
//    public void schedulesByReport(HttpServletResponse response) {
//        productionService.schedulesByReport(response);
//    }
//
//    // 查询生产排程详细信息->批量修改批次or批量新增批次
//    @PostMapping("/findScheduleRecords")
//    @ApiOperation("查询生产排程详细信息")
//    public AjaxResult findScheduleRecords(@ApiParam(name = "schedulesBody", value = "生产排程入参（根据订单编号number找批次）") @RequestBody SchedulesBody schedulesBody) {
//        return productionService.findScheduleRecords(schedulesBody);
//    }
//
//    @PostMapping("/findApprovals")
//    @ApiOperation("查询审批管理信息")
//    public AjaxResult findApprovals(@ApiParam(name = "approvalsBody", value = "审批管理入参") @RequestBody ApprovalsBody approvalsBody) {
//        return productionService.findApprovals(approvalsBody);
//    }
//
//    @PostMapping("/addApprovals")
//    @ApiOperation("新增审批管理")
//    public AjaxResult addApprovals(@ApiParam(name = "approvals", value = "审批管理入参") @RequestBody Approvals approvals) {
//        return productionService.addApprovals(approvals);
//    }
//
//    @PostMapping("/updateApprovals")
//    @ApiOperation("更新审批管理")
//    public AjaxResult updateApprovals(@ApiParam(name = "approvals", value = "审批管理入参") @RequestBody Approvals approvals) {
//        return productionService.updateApprovals(approvals);
//    }
//
//    @PostMapping("/approvalsByReport")
//    @ApiOperation("下载审批管理")
//    public void approvalsByReport(HttpServletResponse response) {
//        productionService.approvalsByReport(response);
//    }
//
//    @PostMapping("/findAssignments")
//    @ApiOperation("查询任务管理信息")
//    public AjaxResult findAssignments(@ApiParam(name = "assignmentsBody", value = "任务管理入参") @RequestBody AssignmentsBody assignmentsBody) {
//        return productionService.findAssignments(assignmentsBody);
//    }
//
//
//    @PostMapping("/taskStart")
//    @ApiOperation("任务开始")
//    public AjaxResult taskStart(@ApiParam(name = "id", value = "任务id") @RequestParam Long id) {
//        return AjaxResult.success(productionService.taskStart(id));
//    }
//
//    @PostMapping("/taskFinish")
//    @ApiOperation("任务完成")
//    public AjaxResult taskFinish(@RequestBody Assignments assignments) {
//        return AjaxResult.success(productionService.taskFinish(assignments));
//    }
//
//    @PostMapping("/findAssignmentsDetail")
//    @ApiOperation("查询任务详情信息")
//    public AjaxResult findAssignmentsDetail(@ApiParam(name = "id", value = "任务id") @RequestParam Long id) {
//        return AjaxResult.success(productionService.findAssignmentsDetail(id));
//    }
//
//    @PostMapping("/queryTaskEventType")
//    @ApiOperation("查询任务事件类型")
//    public AjaxResult queryTaskEventType() {
//        return AjaxResult.success(productionService.queryTaskEventType());
//    }
//
//    @PostMapping("/queryTaskEventList")
//    @ApiOperation("查询任务事件，根据类型")
//    public AjaxResult queryTaskEventListByType(@ApiParam(name = "typeId", value = "事件类型") @RequestParam Long typeId) {
//        return AjaxResult.success(productionService.queryTaskEventListByType(typeId));
//    }
//
//
//    @PostMapping("/addAssignments")
//    @ApiOperation("新增任务管理")
//    public AjaxResult addAssignments(@ApiParam(name = "assignments", value = "任务管理入参") @RequestBody Assignments assignments) {
//        return productionService.addAssignments(assignments);
//    }
//
//    @PostMapping("/updateAssignments")
//    @ApiOperation("更新增任务管理")
//    public AjaxResult updateAssignments(@ApiParam(name = "assignments", value = "任务管理入参") @RequestBody Assignments assignments) {
//        return productionService.updateAssignments(assignments);
//    }
//
//    @PostMapping("/assignmentsByReport")
//    @ApiOperation("下载增任务管理信息")
//    public void assignmentsByReport(HttpServletResponse response) {
//        productionService.assignmentsByReport(response);
//    }
//
//
//    // todo：人员详情信息
//
//    @GetMapping("/findProductionByUserId")
//    @ApiOperation("根据用户id查询批次信息")
//    public AjaxResult findProductionByUserId(@ApiParam(name = "userId", value = "用户id") @RequestParam Integer userId, @ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize) {
//        return productionService.findProductionByUserId(userId, currPage, pageSize);
//    }
//
//    @GetMapping("/findSubsectionByUserId")
//    @ApiOperation("根据用户id查询分段信息")
//    public AjaxResult findSubsectionByUserId(@ApiParam(name = "userId", value = "用户id") @RequestParam Integer userId, @ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize) {
//        return productionService.findSubsectionByUserId(userId, currPage, pageSize);
//    }
//
//    @GetMapping("/findPlanByUserId")
//    @ApiOperation("根据用户id查询计划信息")
//    public AjaxResult findPlanByUserId(@ApiParam(name = "userId", value = "用户id") @RequestParam Integer userId) {
//        return productionService.findPlanByUserId(userId);
//    }
//
//    @GetMapping("/findBatchNumberByOrderNumber")
//    @ApiOperation("据订单编号查询批次编号")
//    public AjaxResult findBatchNumberByOrderNumber(@ApiParam(name = "orderNumber", value = "订单编号") @RequestParam Integer orderNumber) {
//        return productionService.findBatchNumberByOrderNumber(orderNumber);
//    }
//
//    @GetMapping("/findSectionNumberByBatchNumber")
//    @ApiOperation("根据批次编号查询分段编号")
//    public AjaxResult findSectionNumberByBatchNumber(@ApiParam(name = "batchNumber", value = "分段编号") @RequestParam Integer batchNumber) {
//        return productionService.findSectionNumberByBatchNumber(batchNumber);
//    }
//
//    @GetMapping("/findOrderLineDetailsNumber")
//    @ApiOperation("查询所有订单编号下拉框")
//    public AjaxResult findOrderLineDetailsNumber() {
//        return productionService.findOrderLineDetailsNumber();
//    }
//
//    @GetMapping("/findMaterialsClassify")
//    @ApiOperation("查询所有物料分类下拉框信息")
//    public AjaxResult findMaterialsClassify() {
//        return productionService.findMaterialsClassify();
//    }
//
//    @GetMapping("/findMaterialsCraft")
//    @ApiOperation("查询所有工艺下拉框信息")
//    public AjaxResult findMaterialsCraft() {
//        return productionService.findMaterialsCraft();
//    }
//
//    @GetMapping("/findAssignmentsByUserId")
//    @ApiOperation("根据用户id查询任务列表")
//    public AjaxResult findAssignmentsByUserId(@ApiParam(name = "userId", value = "用户id") @RequestParam Integer userId, @ApiParam(name = "currPage", value = "当前页") @RequestParam Integer currPage, @ApiParam(name = "pageSize", value = "当前页条数") @RequestParam Integer pageSize) {
//        return productionService.findAssignmentsByUserId(userId, currPage, pageSize);
//    }
//
//    @PostMapping("/findScheduleBatchesByScheduleId")
//    @ApiOperation("根据排程id找批次和分段")
//    public AjaxResult findScheduleBatchesByScheduleId(@ApiParam(name = "orderBody", value = "排程入参") @RequestBody OrderBody orderBody) {
//        return productionService.findScheduleBatchesByScheduleId(orderBody);
//    }
//
//    @GetMapping("/findScheduleMaterialByScheduleId")
//    @ApiOperation("根据任务id找任务类型和物料信息")
//    public AjaxResult findScheduleMaterialByScheduleId(@ApiParam(name = "scheduleId", value = "任务id") @RequestParam Integer scheduleId) {
//        return productionService.findScheduleMaterialByScheduleId(scheduleId);
//    }
//
//    @GetMapping("/findAssignmentTemplateMiddle")
//    @ApiOperation("审批编辑项查询")
//    public AjaxResult findAssignmentTemplateMiddle(@ApiParam(name = "approvalId", value = "审批id") @RequestParam Integer approvalId) {
//        return productionService.findAssignmentTemplateMiddle(approvalId);
//    }
//
//    // todo:移动端补充接口
//
//    @PostMapping("/findUserInformationById")
//    @ApiOperation("查询员工的首页信息")
//    public AjaxResult findUserInformationById() {
//        return AjaxResult.success(productionService.findUserInformationById());
//    }
//
//    @PostMapping("/findUserBatchScheduleById")
//    @ApiOperation("查询员工的批次进度")
//    public AjaxResult findUserBatchScheduleById() {
//        return AjaxResult.success(productionService.findUserBatchScheduleById());
//    }
//
//    @PostMapping("/findExamineParticulars")
//    @ApiOperation("查询移动端审批详情信息")
//    public AjaxResult findExamineParticulars(@ApiParam(name = "approvalsBody", value = "审批管理入参") @RequestBody ApprovalsBody approvalsBody) {
//        return productionService.findExamineParticulars(approvalsBody);
//    }
//
//    @PostMapping("/findOrderParticularsInfo")
//    @ApiOperation("查询移动端订单详情信息")
//    public AjaxResult findOrderParticularsInfo(@ApiParam(name = "orderBody", value = "订单对象传入订单id") @RequestBody OrderBody orderBody) {
//        return productionService.findOrderParticularsInfo(orderBody);
//    }
//
//    @PostMapping("/findScheduleParticularsInfo")
//    @ApiOperation("查询移动端排程详情信息")
//    public AjaxResult findScheduleParticularsInfo(@ApiParam(name = "schedulesBody", value = "排程对象传入排程id") @RequestBody SchedulesBody schedulesBody) {
//        return productionService.findScheduleParticularsInfo(schedulesBody);
//    }
//
//    @PostMapping("/updateExamineParticulars")
//    @ApiOperation("更新移动端审批状态：通过、不通过")
//    public AjaxResult updateExamineParticulars(@ApiParam(name = "approvalsBody", value = "审批管理入参") @RequestBody ApprovalsBody approvalsBody) {
//        return productionService.updateExamineParticulars(approvalsBody);
//    }
//
//
//}
